#include "StdAfx.h"
#include "AnimationRotateRoundUpLift.h"
#include <cmath>

const double PI = std::atan(1.0)*4;

CAnimationRotateRoundUpLift::CAnimationRotateRoundUpLift(void)
{
	m_time = 0;
	m_angle = 0.0;
}

CAnimationRotateRoundUpLift::~CAnimationRotateRoundUpLift(void)
{
}


void CAnimationRotateRoundUpLift::Update(void)
{
	m_time++;
	m_time %= 200;

	if((m_time >= 0) && (m_time < 10))
	{
		m_angle = 0.0;
	}
	else
	{
		m_angle = -abs(50 *	sin((m_time - 10) / (9.6 * PI) ));
	}
		

	m_node->SetAngle(m_angle);
}